<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>电梯维保记录管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {
            //$("#name").focus();
            $("#inputForm").validate({
                submitHandler: function (form) {
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function (error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });

        function viewPhoto(photourl) {
            var html = "<div style='text-align:center;padding:10px;'><img src='" + photourl + "' width=\"300\" height=\"400\"></div>";
            top.$.jBox.open(html, "签名图片", 330, 635, {
                buttons: {"关闭": true}, loaded: function (h) {
                    $(".jbox-content", top.document).css("overflow-y", "hidden");
                }
            });
        }
    </script>
</head>
<body>
<!--
<ul class="nav nav-tabs">
    <li><a href="${ctx}/elmt/maintenanceRecordSz/list">电梯维保记录列表</a></li>
    <li class="active"><a href="${ctx}/elmt/maintenanceRecordSz/form?id=${maintenanceRecordSz.recordId}">电梯维保记录查看</a></li>
    <li><a href="${ctx}/elmt/maintenanceRecordItem/?recordId=${maintenanceRecordSz.recordId}">电梯维保记录明细列表</a></li>
</ul>
<br/>
-->
<form:form id="inputForm" modelAttribute="maintenanceRecordSz" action="${ctx}/elmt/maintenanceRecordSz/save" method="post" class="form-horizontal">
    <form:hidden path="recordId"/>
    <sys:message content="${message}"/>
    <div class="container-fluid">
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">维保记录编号：</label>

                    <div class="col-xs-8">
                        <form:input path="recordNo" htmlEscape="false" maxlength="20" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">使用单位名称：</label>

                    <div class="col-xs-8">
                        <form:input path="useUnitName" htmlEscape="false" maxlength="100" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">单位内部编号：</label>

                    <div class="col-xs-8">
                        <form:input path="internalCode" htmlEscape="false" maxlength="20" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">设备所在地点：</label>

                    <div class="col-xs-8">
                        <form:input path="deviceAddr" htmlEscape="false" maxlength="100" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">安全管理人员：</label>

                    <div class="col-xs-8">
                        <form:input path="safetyOfficer" htmlEscape="false" maxlength="20" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">联系电话：</label>

                    <div class="col-xs-8">
                        <form:input path="safetyPhone" htmlEscape="false" maxlength="20" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">设备注册代码：</label>

                    <div class="col-xs-8">
                        <form:input path="deviceCode" htmlEscape="false" maxlength="20" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">制造单位：</label>

                    <div class="col-xs-8">
                        <form:input path="manufactureUnit" htmlEscape="false" maxlength="100" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">出厂编号：</label>

                    <div class="col-xs-8">
                        <form:input path="serialNumber" htmlEscape="false" maxlength="50" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">安装单位：</label>

                    <div class="col-xs-8">
                        <form:input path="installationUnit" htmlEscape="false" maxlength="100" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">改造单位：</label>

                    <div class="col-xs-8">
                        <form:input path="remouldUnit" htmlEscape="false" maxlength="100" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">重大维修单位：</label>

                    <div class="col-xs-8">
                        <form:input path="maintenanceUnit" htmlEscape="false" maxlength="100" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">电梯品种：</label>

                    <div class="col-xs-8">
                        <form:select path="deviceVariety" class="form-control input-sm input-xlarge required">
                            <form:option value="" label=""/>
                            <form:options items="${fns:getDictList('XT_SBPZ')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                        </form:select>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">原型号：</label>

                    <div class="col-xs-8">
                        <form:input path="modelSpec" htmlEscape="false" maxlength="50" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">改造后型号：</label>

                    <div class="col-xs-8">
                        <form:input path="remouldModelSpec" htmlEscape="false" maxlength="50" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">驱动方式：</label>

                    <div class="col-xs-8">
                        <form:input path="driveMode" htmlEscape="false" maxlength="40" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">额定载重量（KG）：</label>

                    <div class="col-xs-8">
                        <form:input path="ratedLoad" htmlEscape="false" class="form-control input-sm input-xlarge  number"/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">额定速度（m/s）：</label>

                    <div class="col-xs-8">
                        <form:input path="ratedSpeed" htmlEscape="false" class="form-control input-sm input-xlarge  number"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">层数：</label>

                    <div class="col-xs-8">
                        <form:input path="elevatorLayers" htmlEscape="false" maxlength="4" class="form-control input-sm input-xlarge  digits"/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">站数：</label>

                    <div class="col-xs-8">
                        <form:input path="elevatorStations" htmlEscape="false" maxlength="4" class="form-control input-sm input-xlarge  digits"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">顶升型式：</label>

                    <div class="col-xs-8">
                        <form:input path="liftType" htmlEscape="false" maxlength="20" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">油缸数量：</label>

                    <div class="col-xs-8">
                        <form:input path="cylinderNumber" htmlEscape="false" maxlength="4" class="form-control input-sm input-xlarge  digits"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">使用区段长度（人行道）：</label>

                    <div class="col-xs-8">
                        <form:input path="sectionLength" htmlEscape="false" class="form-control input-sm input-xlarge  number"/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">倾斜角度：</label>

                    <div class="col-xs-8">
                        <form:input path="slopeAngel" htmlEscape="false" class="form-control input-sm input-xlarge  number"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">提升高度：</label>

                    <div class="col-xs-8">
                        <form:input path="liftHeight" htmlEscape="false" class="form-control input-sm input-xlarge  number"/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">梯级宽度：</label>

                    <div class="col-xs-8">
                        <form:input path="stepWidth" htmlEscape="false" class="form-control input-sm input-xlarge  number"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">电机功率：</label>

                    <div class="col-xs-8">
                        <form:input path="motorPower" htmlEscape="false" class="form-control input-sm input-xlarge  number"/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">维保单位代码：</label>

                    <div class="col-xs-8">
                        <form:input path="maintenUnitCode" htmlEscape="false" maxlength="20" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">维保单位名称：</label>

                    <div class="col-xs-8">
                        <form:input path="maintenUnitName" htmlEscape="false" maxlength="100" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">通知时间：</label>

                    <div class="col-xs-8">
                        <input name="noticeTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
                               value="<fmt:formatDate value="${maintenanceRecordSz.noticeTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                               onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">服务性质：</label>

                    <div class="col-xs-8">
                        <form:select path="serviceNature" class="form-control input-sm input-xlarge ">
                            <form:option value="" label=""/>
                            <form:options items="${fns:getDictList('SERVICE_NATURE')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                        </form:select>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">服务性质补充说明：</label>

                    <div class="col-xs-8">
                        <form:input path="serviceNatureDesc" htmlEscape="false" maxlength="50" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">维保类型：</label>

                    <div class="col-xs-8">
                        <form:checkbox path="halfmonthMainType" value="1" class="minimal " disabled="true" label="半月维保"/>
                        <form:checkbox path="quarterMainType" value="1" class="minimal " disabled="true" label="季度维保"/>
                        <form:checkbox path="halfyearMainType" value="1" class="minimal " disabled="true" label="半年维保"/>
                        <form:checkbox path="yearMainType" value="1" class="minimal " disabled="true" label="年度维保"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">到达时间：</label>

                    <div class="col-xs-8">
                        <input name="signInTime" type="text" readonly="readonly" maxlength="20" class="form-control input-sm input-medium Wdate "
                               value="<fmt:formatDate value="${maintenanceRecordSz.signInTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                               onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">结束时间：</label>

                    <div class="col-xs-8">
                        <input name="completionTime" type="text" readonly="readonly" maxlength="20" class="form-control input-sm input-medium Wdate "
                               value="<fmt:formatDate value="${maintenanceRecordSz.completionTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                               onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:10px">
            <div class="col-xs-6">
                <div class="form-group">
                    <div class="col-xs-12">
                        <form:checkbox path="knowRunCondition" value="1" label="工作前已了解电梯运行情况,挂保养牌，做好安全防护措施）" class="minimal"></form:checkbox>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <div class="col-xs-12">
                        <form:checkbox path="knowFailureCondition" value="1" label="维修工作前已了解电梯故障情况,挂维修牌，做好安全防护措施）" class="minimal"></form:checkbox>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="control-label col-xs-2">故障现象：</label>

                    <div class="col-xs-10">
                        <form:checkboxes path="failureStatusList" items="${allFailureStatus}" itemLabel="label" itemValue="value" htmlEscape="false" disabled="true"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="control-label col-xs-2">处理过程和结果：</label>

                    <div class="col-xs-10">
                        <form:textarea path="hiddenTroubleTreatment" cssStyle="width: 77%;" htmlEscape="false" maxlength="500" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">更换配件报价单编号：</label>

                    <div class="col-xs-8">
                        <form:input path="quotationOrderNo" htmlEscape="false" maxlength="20" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">送货单编号：</label>

                    <div class="col-xs-8">
                        <form:input path="deliveryOrderNo" htmlEscape="false" maxlength="20" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">维保结论：</label>

                    <div class="col-xs-8">
                        <form:select path="maintenanceResult" class="form-control input-sm input-large ">
                            <form:option value="" label=""/>
                            <form:options items="${fns:getDictList('MT_RESULT')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                        </form:select>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">维保人员签名：</label>

                    <div class="col-xs-8">
                        <form:input path="maintenanceStaff1Name" htmlEscape="false" maxlength="20" class="form-control input-sm input-mini "/>
                        <c:if test="${not empty maintenanceRecordSz.maintenanceStaff1Photo}">
                            <input class="btn" type="button" value="查看签名" onclick="viewPhoto('<c:out value="${maintenanceRecordSz.maintenanceStaff1Photo}"/>')"/>
                        </c:if>
                        <form:input path="maintenanceStaff2Name" htmlEscape="false" maxlength="20" class="form-control input-sm input-mini "/>
                        <c:if test="${not empty maintenanceRecordSz.maintenanceStaff2Photo}">
                            <input class="btn" type="button" value="查看签名" onclick="viewPhoto('<c:out value="${maintenanceRecordSz.maintenanceStaff2Photo}"/>')"/>
                        </c:if>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="control-label col-xs-2">使用单位意见：</label>

                    <div class="col-xs-10">
                        <form:textarea path="useUnitOption" cssStyle="width: 77%;" htmlEscape="false" maxlength="200" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">安全管理人员签名：</label>

                    <div class="col-xs-8">
                        <form:input path="safetyOfficerId" htmlEscape="false" maxlength="20" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-xs-4">安全管理人员确认时间：</label>

                    <div class="col-xs-8">
                        <input name="confirmTime" type="text" readonly="readonly" maxlength="20" class="form-control input-sm input-medium Wdate "
                               value="<fmt:formatDate value="${maintenanceRecordSz.confirmTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                               onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="padding-top:5px">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="control-label col-xs-2">其它记录或备注：</label>

                    <div class="col-xs-10">
                        <form:textarea path="otherRemark" cssStyle="width: 77%;" htmlEscape="false" maxlength="200" class="form-control input-sm input-xlarge "/>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="form-actions" style="text-align: center">
        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
    </div>
</form:form>
</body>
</html>